Receives the message from the destination for this consumer. The object must be de-serializable from XML.

Namespace:  Apache.NMS
Assembly:  Apache.NMS (in Apache.NMS.dll)

Syntax

Visual Basic
<ExtensionAttribute> _
Public Shared Function Receive(Of T As Class) ( _
	consumer As IMessageConsumer, _
	timeout As TimeSpan _
) As T
C#
public static T Receive<T>(
	this IMessageConsumer consumer,
	TimeSpan timeout
)
where T : class
Visual C++
[ExtensionAttribute]
public:
generic<typename T>
where T : ref class
static T Receive(
	IMessageConsumer^ consumer, 
	TimeSpan timeout
)
JavaScript
JavaScript does not support generic types or methods.

Parameters

consumer
Type: Apache.NMS..::..IMessageConsumer
timeout
Type: System..::..TimeSpan

Type Parameters

T

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IMessageConsumer. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also